package com.gec.it.entity;
import com.baomidou.mybatisplus.annotation.*;
import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.Task;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 雄哥爱吃肉
 * @since 2022-01-04
 */
@TableName("HP_PLANS")
@KeySequence("SEQ_HP_PLANS")
public class Plans implements Serializable {

    private static final long serialVersionUID = 1L;
    //任务流的task外键------------------
    @TableField(exist=false)
    private Task task;
    public Task getTask() {
        return task;
    }
    public void setTask(Task task) {
        this.task = task;
    }
    @TableField(exist=false)
    private List<IdentityLink> groupLinks;
    public List<IdentityLink> getGroupLinks() {
        return groupLinks;
    }
    public void setGroupLinks(List<IdentityLink> groupLinks) {
        this.groupLinks = groupLinks;
    }

    public String getGroupLinksName(){
        List<String> list=new ArrayList<String>();
        for(IdentityLink lk:groupLinks){
            list.add(lk.getUserId());
        }
        return String.join(",", list);
    }
    //------------------------------------------
    @TableId(value = "PLAN_ID",type = IdType.INPUT)
    private Integer planId;

    /**
     * 医生
     */
    @TableField("PLAN_DOC_ID")
    private Integer planDocId;

    /**
     * 出诊日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("PLAN_DATE")
    private Date planDate;

    /**
     * 1-上午,2-下午
     */
    @TableField("PLAN_TIMETYPE")
    private Integer planTimetype;

    /**
     * 挂号费
     */
    @TableField("PLAN_FEE")
    private Integer planFee;

    /**
     * 出诊诊室
     */
    @TableField("PLAN_ROOM")
    private String planRoom;

    /**
     * 此次出诊放号总数
     */
    @TableField("PLAN_MAX")
    private Integer planMax;

    /**
     * 当前剩余号数
     */
    @TableField("PLAN_CAN")
    private Integer planCan;

    /**
     * 1-正常 2-取消
     */
    @TableField("PLAN_STATE")
    private Integer planState;

    /**
     * 申请/科室审批/院长审批/场地审批/医生确认
     */
    @TableField("PLAN_WF_STATE")
    private String planWfState;

    @TableField(exist = false)
    private Doctors doc;

    public void setDoc(Doctors doc) {
        this.doc = doc;
    }

    public Doctors getDoc() {
        return doc;
    }

    public Integer getPlanId() {
        return planId;
    }

    public void setPlanId(Integer planId) {
        this.planId = planId;
    }

    public Integer getPlanDocId() {
        return planDocId;
    }

    public void setPlanDocId(Integer planDocId) {
        this.planDocId = planDocId;
    }

    public Date getPlanDate() {
        return planDate;
    }

    public void setPlanDate(Date planDate) {
        this.planDate = planDate;
    }

    public Integer getPlanTimetype() {
        return planTimetype;
    }

    public void setPlanTimetype(Integer planTimetype) {
        this.planTimetype = planTimetype;
    }

    public Integer getPlanFee() {
        return planFee;
    }

    public void setPlanFee(Integer planFee) {
        this.planFee = planFee;
    }

    public String getPlanRoom() {
        return planRoom;
    }

    public void setPlanRoom(String planRoom) {
        this.planRoom = planRoom;
    }

    public Integer getPlanMax() {
        return planMax;
    }

    public void setPlanMax(Integer planMax) {
        this.planMax = planMax;
    }

    public Integer getPlanCan() {
        return planCan;
    }

    public void setPlanCan(Integer planCan) {
        this.planCan = planCan;
    }

    public Integer getPlanState() {
        return planState;
    }

    public void setPlanState(Integer planState) {
        this.planState = planState;
    }

    public String getPlanWfState() {
        return planWfState;
    }

    public void setPlanWfState(String planWfState) {
        this.planWfState = planWfState;
    }

    @Override
    public String toString() {
        return "Plans{" +
        ", planId=" + planId +
        ", planDocId=" + planDocId +
        ", planDate=" + planDate +
        ", planTimetype=" + planTimetype +
        ", planFee=" + planFee +
        ", planRoom=" + planRoom +
        ", planMax=" + planMax +
        ", planCan=" + planCan +
        ", planState=" + planState +
        ", planWfState=" + planWfState +
        "}";
    }
}
